package lolic;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

/**
 * 
 * @author Dave DePiano
 *
 */
public class Main {

	public static void main(String[] args)  
	{
		File fErrorLog = new File("error.log");
		// start a new file if the log file gets too big
		if (fErrorLog.length() > (1024 * 1024 * 3))
			fErrorLog.delete();
		PrintStream out;
		try {
			out = new PrintStream(new FileOutputStream(fErrorLog, true));
			System.setErr(out);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		GUI gui = new GUI();
	}

}



/*   ignore my junk

//make the items.xml file (just used for setup use during production)

try {
FileInputStream fstream = new FileInputStream("items.txt");
DataInputStream in = new DataInputStream(fstream);
  BufferedReader br = new BufferedReader(new InputStreamReader(in));
  String strLine;
  String[] splitter;
  while ((strLine = br.readLine()) != null)   {
	  // Print the content on the console
	  
	  splitter = strLine.split("=");
	  System.out.println ("<Item name=\"" + splitter[1].trim() + "\" id =\"" + splitter[0].trim() + "\"></Item>");
	  }
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


//make the champ.xml file from the 

File dir = new File("C:\\Users\\Dave\\Downloads\\RecItemsTemplate\\Characters");  
		       
		    File[] subDirs = dir.listFiles(new FileFilter() {  
		        public boolean accept(File pathname) {  
		            return pathname.isDirectory();  
		        }  
		    });  
		       
		    for (File subDir : subDirs) {  
		      // System.out.println(subDir.getName());  
		       System.out.println("<Champ name=\"" + subDir.getName() + "\" id=\"\"/>");
		   }  
*/
